package com.beater.controller.bean;

import com.beater.global.ApiConstant;

public class ResponseBean {
	private int code ;
	private String msg ;
	private Object data ;
	
	
	
	
	
	public static ResponseBean toSuccessJsonBean(Object data){
		ResponseBean responseBean = new ResponseBean() ;
		responseBean.setCode(ApiConstant.RS_CODE_OK);
		responseBean.setMsg("请求成功");
		responseBean.setData(data);
		return responseBean ;
		
	}
	public static ResponseBean toFailJsonBean(){
		ResponseBean responseBean = new ResponseBean() ;
		responseBean.setCode(ApiConstant.RS_CODE_SERVER_EX);
		responseBean.setMsg("请求失败");
		return responseBean ;
		
	}
	
	
	public ResponseBean() {
	}
	public ResponseBean(int code, String msg, Object data) {
		super();
		this.code = code;
		this.msg = msg;
		this.data = data;
	}
	@Override
	public String toString() {
		return "ResponseBean [code=" + code + ", msg=" + msg + ", data=" + data
				+ ", getCode()=" + getCode() + ", getMsg()=" + getMsg()
				+ ", getData()=" + getData() + ", getClass()=" + getClass()
				+ ", hashCode()=" + hashCode() + ", toString()="
				+ super.toString() + "]";
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	

}
